<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Person {
            name
            //#相当于private
            #web
            constructor(name, web) {
                this.name = name
                this.#web = web
            }
            get web() {
                return this.#web
            }
            set web(value) {
                this.#web = value
            }
            info() {
                // return "姓名：" + this.name + "网站：" + this.web
                //格式化输出`xx${}xx`
                return `姓名:${this.name}网站：${this.web}`
            }
        }
        let person = new Person("邓睿", "dengruicode.com")
        console.log(person.web)
        person.web = "163.com"
        console.log(person.web)
        console.log(person.info())
    </script>
</body>

</html>